<ion-view view-title="存入" hide-tabs="true">
  <ion-content class="content ionic-pseudo">
    <div class="sub-header size-21">
      <img src="img/time.png" alt="" />
      <span>{{product.name}}</span>
    </div>

    <div class="pay-product-info">
      <div class="rate">
        <p>年化收益</p>
        <b class="assertive size-16">{{product.incomeRate}}&nbsp;%</b>
      </div>
      <div class="deadline">
        <p>投资期限</p>
        <b class="assertive size-16">{{product.investDateNumberStr}}</b>
      </div>
      <div class="remain-price">
        <p>剩余额度</p>
        <b class="assertive size-16">¥{{product.remainingAmount}}</b>
      </div>
      <div class="pay">
        <span>存入进度</span>
      </div>
      <div class="process"></div>  
      <div class="border" style="width:{{0.5*product.finishPer}}%"></div>
      <span class="process-number">{{product.finishPer}}%</span>
    </div>

    <div class="list">
      <label class="item item-input">
        <span class="input-label">可买余额</span>{{product.remainingAmount}}
      </label>
      <label class="item item-input" ng-if="pmin">
        <span class="input-label">存入金额</span>
        <input class="number" type="text" placeholder="最少存入{{product.minTradeAmount}}元" ng-model="trdata.TradeAmount">           
      </label>
      <label class="item item-input" ng-if="!pmin">
        <span class="input-label">存入金额</span>
        <input class="number" type="text" placeholder="最少存入{{trdata.requiredAmount}}元" ng-model="trdata.TradeAmount">           
      </label><!-- 
      <label class="item item-input">
        <span class="input-label">预计收益 定期</span>                   
      </label> -->
      <label class="item item-list item-icon-right" ng-click="voucher()">
        <span class="input-label">优惠券</span>
        <span ng-if="trdata.discountAmountDesc">{{trdata.discountAmountDesc}}</span>
        <i class="icon ion-ios-arrow-right"></i>          
      </label><!-- ng-if="trdata.voucher" -->
      <!-- <label class="item  item-list item-icon-right">
        <span class="input-label">加息券</span>
        <span style="width:58%;float:right;">{{}}30天0.20%加息券</span>{{trdata.voucher}}
        <i class="icon ion-ios-arrow-right"></i>         
      </label> -->
      <label class="item item-list item-icon-right" ng-click="payment()">
        <span class="input-label">支付方式</span>
        <span ng-if="trdata.paymentmethod">{{trdata.bankName}}--尾号{{trdata.cardNumber | limitTo:-4}}</span>
        <i class="icon ion-ios-arrow-right"></i>
      </label>
      <!--<label class="item item-list item-input" ng-if="istradepwd">
        <span class="input-label">交易密码</span>
        <input type="password"placeholder="请填写交易密码" ng-model="trdata.tradePwd">
      </label> -->
      <label class="item item-input" ng-if="!istradepwd" ng-click="settradepwd()">
        <span class="input-label">交易密码</span>
        <a class="assertive">前往设置交易密码</a>
      </label>
      <div class="item-paycheckbox padding-horizontal size-16">
        <div class="paycheckbox tc size-21" ng-if="agree" ng-click="disagree()"><i class="icon ion-android-checkbox-outline positive"></i></div>
        <div class="paycheckbox tc size-21" ng-if="!agree" ng-click="agreec()"><i class="icon ion-android-checkbox-outline-blank positive"></i></div>
        <span>同意</span><span class="positive" ng-click="agreement()">《服务协议》</span>
      </div>
    </div>    
  </ion-content>
<!--   <div class="bar bar-footer bar-positive" ng-click="pay()" style="position:absolute;bottom:0;">
  <div class="title">
    <a class="button button-clear" ng-if="trdata.TradeAmount" ng-disabled="!payable" >实际支付{{trdata.TradeAmount-trdata.discountAmount}}元</a>
    <a class="button button-clear" ng-if="!trdata.TradeAmount" ng-disabled="!payable">请填写存入金额</a>
  </div>
</div> -->
  <ion-footer-bar class="bar-positive" align-title="center" keyboard-attach>
    <h1 class="title" ng-click="pay()">
      <span class="button button-clear" ng-if="trdata.TradeAmount" ng-disabled="!payable" >实际支付{{trdata.TradeAmount-trdata.discountAmount}}元</span>
      <span class="button button-clear" ng-if="!trdata.TradeAmount" ng-disabled="!payable">请填写存入金额</span>
    </h1>
  </ion-footer-bar>
</ion-view>

<script id="tradepwd.html" type="text/ng-template">
<div class="tc pr size-14">请输入金法宝交易密码
<span class="closetwd fr" ng-click="canceltwd()"><i class="icon size-18 ion-close-round"></i></span>
</div>
<div class="tc padding">
支付金额：{{trdata.TradeAmount-trdata.discountAmount}}元{{}}
</div>
<div class="passContainer tc" ng-click="shownumberkeyboard()">
    <div class="passItem"><i class="icon size-24 positive icon-jiaqian" ng-if="pwdlenght>=1"></i></div>
    <div class="passItem"><i class="icon size-24 positive icon-jiaqian" ng-if="pwdlenght>=2"></i></div>
    <div class="passItem"><i class="icon size-24 positive icon-jiaqian" ng-if="pwdlenght>=3"></i></div>
    <div class="passItem"><i class="icon size-24 positive icon-jiaqian" ng-if="pwdlenght>=4"></i></div>
    <div class="passItem"><i class="icon size-24 positive icon-jiaqian" ng-if="pwdlenght>=5"></i></div>
    <div class="passItem"><i class="icon size-24 positive icon-jiaqian" ng-if="pwdlenght>=6"></i></div>
</div>
<div class="tc">
<button class="button button-full button-positive" ng-disabled="pwdlenght!=6" ng-click="placeOrder()">确定</button>
</div>
</script>
<!-- /*<input class="trade-input" type="password" ng-model="trdata.tradepwd" maxlength="6">*/ -->